package com.xgk.boot.module.core.dal.entity.order;

import com.baomidou.mybatisplus.annotation.*;
import com.xgk.boot.framework.mybatis.core.dataobject.BaseDO;
import lombok.Data;

import java.util.Date;

/**
 * <p>
 * 订单日志表
 * </p>
 *
 * @author yfbao
 * @since 2025-06-14
 */
@Data
@TableName("order_log")
public class OrderLogDO extends BaseDO {

    @TableId(value = "ol_id", type = IdType.ASSIGN_ID)
    private Long olId;

    /**
     * 操作类型：创建add，编辑edit，提交submit，变更状态change，签出out，其他other
     */
    @TableField(value = "op_type")
    private String opType;

    /**
     * 订单ID
     */
    @TableField(value = "order_id")
    private Long orderId;

    /**
     * 订单编号
     */
    @TableField(value = "order_code")
    private String orderCode;

    /**
     * 变更类型：0状态变更，1内容变更
     */
    @TableField(value = "ol_type")
    private Integer olType;

    /**
     * 变化前状态
     */
    @TableField(value = "order_status_from")
    private Integer orderStatusFrom;

    /**
     * 变化后状态
     */
    @TableField(value = "order_status_to")
    private Integer orderStatusTo;

    /**
     * 发生时间
     */
    @TableField(value = "ol_add_time", fill = FieldFill.INSERT)
    private Date olAddTime;

    /**
     * 操作用户ID：0系统，-1客户自操作
     */
    @TableField(value = "user_id")
    private Integer userId;

    /**
     * 访问IP
     */
    @TableField(value = "ol_ip")
    private String olIp;

    /**
     * 备注信息
     */
    @TableField(value = "ol_comments")
    private String olComments;

    @Override
    public String toString() {
        return "OrderLog{" +
                ", olId = " + olId +
                ", opType = " + opType +
                ", orderId = " + orderId +
                ", orderCode = " + orderCode +
                ", olType = " + olType +
                ", orderStatusFrom = " + orderStatusFrom +
                ", orderStatusTo = " + orderStatusTo +
                ", olAddTime = " + olAddTime +
                ", userId = " + userId +
                ", olIp = " + olIp +
                ", olComments = " + olComments +
                "}";
    }
}
